#include <iostream>
#include <vector>
using namespace std;

const int N = 110;
vector<int> q;
int tmp[N];

vector<int> reOrderArray(vector<int> &a) {
    if(a.empty()) return a;
    int l = -1, r = a.size();
    //快排思想
    while(l < r){
        do l++; while(a[l] % 2 == 1);
        do r--; while(a[r] % 2 == 0);
        if(l < r) swap(a[l], a[r]);
    }
    return a;
}

int main(){
    q.reserve(N);
    scanf("%d", &q);
    q = reOrderArray(q);

    literator it = q.begin();
    for(;it != q.end(); ++it){
        cout << *it << " " ;
    }
    cout << endl;

    return 0;
}